package loes0;

public class Customer extends SortableQueueItem{

	private long timeOfArrival;
	private long serviceInitiation;
	private long serviceCompletion;

	public Customer(long timeOfArrival, long serviceInitiation,
			long serviceCompletion) {
		super();
		this.timeOfArrival = timeOfArrival;
		this.serviceInitiation = serviceInitiation;
		this.serviceCompletion = serviceCompletion;
	}

	@Override
	public int compareTo(SortableQueueItem o) {
		if (o instanceof Customer) {
			Customer e = (Customer) o;
			if(equals(o)) return 0;
			if(timeOfArrival < e.timeOfArrival) return -1;
			if(timeOfArrival > e.timeOfArrival) return 1;
		}
		return 1;
	}

	public long getTimeOfArrival() {
		return timeOfArrival;
	}

	public void setTimeOfArrival(long timeOfArrival) {
		this.timeOfArrival = timeOfArrival;
	}

	public long getServiceInitiation() {
		return serviceInitiation;
	}

	public void setServiceInitiation(long serviceInitiation) {
		this.serviceInitiation = serviceInitiation;
	}

	public long getServiceCompletion() {
		return serviceCompletion;
	}

	public void setServiceCompletion(long serviceCompletion) {
		this.serviceCompletion = serviceCompletion;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Arrival: " + this.timeOfArrival+" | Initialization: " + this.serviceInitiation +" | Completion: " + this.serviceCompletion ;
	}

}
